<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../../assets/layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="../../assets/css/admin.css" />
	</head>
	<body>
		<div style="margin: 30px;">
			<form class="layui-form" action="" method="post" onsubmit="return false;">
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red">*</span>用户账号</label>
					<div class="layui-input-block">
						<input type="text" name="loginName" id="loginName" 
							   autocomplete="off" placeholder="请输用户账号" class="layui-input" required>
					</div>
					<input type="hidden" name="id" id="id">
					<input type="hidden" name="editType" id="editType">
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red">*</span>用户姓名</label>
					<div class="layui-input-block">
						<input type="text" name="name" id="name" 
							   autocomplete="off" placeholder="请输用户姓名" class="layui-input" required>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red">*</span>登录密码</label>
					<div class="layui-input-block">
						<input type="password" name="password" id="password" 
							   autocomplete="off" placeholder="请输访问地址" class="layui-input" required>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red">*</span>用户电话</label>
					<div class="layui-input-block">
						<input type="text" name="mobile" id="mobile" 
							   autocomplete="off" placeholder="请输密码" class="layui-input" required>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label"><span style="color: red">*</span>用户描述</label>
					<div class="layui-input-block">
						<textarea name="remarks" id="remarks"  placeholder="请输入描述内容" 
						class="layui-textarea" required></textarea>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit="" lay-filter="demo1">提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form>
		</div>
		<script type="text/javascript" src="../../js/common/jquery-1.10.2.min.js"></script>
		<script type="text/javascript" src="../../assets/layui/layui.js"></script>
		<script type="text/javascript" src="../../js/common/formUtil.js"></script>
		<script type="text/javascript" src="../../js/common/commonUtil.js"></script>
		<script type="text/javascript">
		   layui.config({
				base: '../../assets/' //静态资源所在路径
			}).extend({
				index: 'lib/index' //主入口模块
			}).use(['index','layer','form'], function() {
				var $ = layui.jquery,
					layer = layui.layer,
				    form = layui.form;
				if (!ComUtil.isEmpty($("#id").val())) {
					ComUtil.AjaxData(".layui-form",path + "/a/sys/UserAction/queryUserById.do", function(obj, data) {
						FromEngine.jsonBindForm(obj, data.data);
					}, {
						userId : $("#id").val()
					});
				}
				
				FromEngine.vsFrom(".layui-form", {
					debug : false,
					beforeSubmitFunction:function(){
						$("#editType").val("<%=type%>");
						return true;
					},
					cfgUrlOrFunction : path + "/a/sys/UserAction/saveUser.do",
					cfgCallBack : function(result) {
						ComUtil.closeParentLayer(function() {
						});
					}
				});
			})
		</script>
		
	</body>	
</html>